<?php
allowCors();
if (!methodsRequired(['get'])) return;
if (!checkAdmin($msg)) return;

if(isset($_REQUEST["dept_id"])){
    $dept_id = $_REQUEST["dept_id"];
    $dept = new Department();
    $dept->setDeptId($dept_id);
    if($db->delete($dept)==1){
        $msg->setCode(0);
    }else{
        $msg->setCode(2);
    }
}else{
    $msg->setCode(2);
}
echo $msg;


